/*
 * Help.java
 *
 * Created on March 22, 2007, 4:42 PM
 */

package d20chat;

import java.awt.*;
import java.lang.Object;


/**
 * Displays a simple window that directs the user to the help webpage.
 * Auto opens up a browser window with the address:
 * http://sourceforge.net/forum/forum.php?forum_id=622940
 */
public class Help extends javax.swing.JFrame {
    
    //public D20Chat tempMain;
    
    
    /** Creates new form Help */
/**
     * Class constructor for Help, displays help window.
     * Autoloads browser with address of the help webpage: 
     * http://sourceforge.net/forum/forum.php?forum_id=622940
     * As well as displays it on screen (for in case the browser launch fails).
     */
    public Help() {
        initComponents();
        
        // Center Help jFrame
        Dimension scrn = getToolkit().getScreenSize();
        this.setBounds( (scrn.width-getWidth())/2, (scrn.height-getHeight())/2, getWidth(), getHeight() );
    }
    
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
/**
     * 
     */
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
    private void initComponents() {
        jLabel1 = new javax.swing.JLabel();
        helpForumURL = new javax.swing.JLabel();

        setTitle("D20 Chat Help");
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowOpened(java.awt.event.WindowEvent evt) {
                formWindowOpened(evt);
            }
        });

        jLabel1.setText("If the help forum doesn't pop up on its own, please visit it at: ");

        helpForumURL.setForeground(new java.awt.Color(102, 102, 102));
        helpForumURL.setText("http://sourceforge.net/forum/forum.php?forum_id=622940");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addComponent(helpForumURL))
                    .addComponent(jLabel1))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(helpForumURL)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened
        BareBonesBrowserLaunch.openURL("http://sourceforge.net/forum/forum.php?forum_id=622940");
    }//GEN-LAST:event_formWindowOpened
    
    
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel helpForumURL;
    private javax.swing.JLabel jLabel1;
    // End of variables declaration//GEN-END:variables
    
}
